-
Notifications
You must be signed in to change notification settings - Fork 473
Don't break us please oh mighty MCT #2714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the ValidationBehavior class by adding two obsolete flag values to the ValidationFlags enum for backward compatibility while updating the file’s imports.
- Introduces obsolete flags ValidateOnFocusing and ValidateOnUnfocusing mapping to ValidateOnFocused and ValidateOnUnfocused.
- Adds the System namespace import, likely to support the Obsolete attribute usage.
Comments suppressed due to low confidence (2)
src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs:26
- Consider expanding the XML documentation for ValidateOnFocusing to mention that this flag is deprecated, including details on the replacement flag and, if applicable, the version since deprecation.
/// <summary> Validate on focusing</summary>
src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs:29
- Consider clarifying the XML documentation for ValidateOnUnfocusing to explicitly note its obsolete status, indicate the recommended alternative flag, and include deprecation details if available.
/// <summary>Validate on unfocusing</summary>
|
Hi Matt! Could you help me understand why we'd add two new flags and immediately mark them obsolete? |
|
Because you broke the world @TheCodeTraveler! You broke my world. lol The MCT renamed the enum values, and this is a breaking change that affects everyone updating from 9.x I think. @jfversluis did we have an issue for the people that were shattered by this betrayal? |
|
Yes, I understand it was a breaking change. We highlighted this change in our documentation and in our release notes. Is there a blocker for you or other developers to modify the values of this enum when upgrading to a new major version? Are there developers unable to modify these enum values? Did this change somehow affect the underlying .NET MAUI framework? Respectfully, we don't get paid to work on this project and this PR adds technical debt to our library. Unless a developer is blocked, I do not advocate we add |
|
I think we can work aaround it to use different values in our templates based on the version of MCT/.NET version we are creating for. I think it was like .NET 9 was using MCT 9 and .NET 10 is using MCT 12, which resulted in the code not working out the box. But Gerald has a fix so this is not so much a blocker but more a sad face emoji type of thing. But yeah, no need to re-mortgage the house on this. |
|
For the specific version in template it works without issues. If users want to update to the next major version of MCT, they can see breaking changes in release notes and respectively apply changes to their code. |
|
Luckily you don't have Popup in template 😃 |
This pull request introduces updates to the
ValidationBehaviorclass and its associatedValidationFlagsenum in theCommunityToolkit.Mauiproject. The changes include adding new obsolete flags for validation behavior and updating the file's imports.Updates to
ValidationFlagsenum:ValidateOnFocusingandValidateOnUnfocusing, which map to existing flagsValidateOnFocusedandValidateOnUnfocused. These changes aim to provide backward compatibility while encouraging the use of newer flag names.Codebase maintenance:
Systemnamespace inValidationBehavior.shared.cs, possibly to support the[Obsolete]attribute or other added functionality.